import request from "@/utils/request";
/*****************  角色管理  *******************/
// 列表
export function roleList(params) {
  return request({
    url: "/role",
    headers: {
      isToken: false,
    },
    method: "get",
    params,
  });
}
// 新增
export function roleAdd(params) {
  return request({
    url: "/role",
    headers: {
      isToken: false,
    },
    method: "post",
    data: params,
  });
}
// 修改
export function roleEdit(id: number, params) {
  return request({
    url: `/role/${id}`,
    headers: {
      isToken: false,
    },
    method: "patch",
    data: params,
  });
}
// 删除
export function roleDel(roleIds) {
  return request({
    url: `/role/delete`,
    headers: {
      isToken: false,
    },
    method: "post",
    data: roleIds,
  });
}
// 详情
export function roleInfo(id) {
  return request({
    url: `/role/${id}`,
    headers: {
      isToken: false,
    },
    method: "get",
  });
}

// 导出
export function roleExport() {
  return request({
    url: `/role/excel`,
    headers: {
      isToken: false,
    },
    method: "post",
    responseType: "blob",
  });
}
